package algebra.op;

import java.util.List;

import algebra.visitors.ScanQueryVisitorCacheSelector;

import entities.ConceptAssertion;
import entities.vocabulary.Display;

public class ScanQuery extends Query {
	private Query sub;
	private List<ConceptAssertion> cache;

	
	public ScanQuery(Query sub){
		super();
		this.sub = sub;
		this.cache = null;
	}
	
//	private ScanQuery(Query sub, List<ConceptAssertion> cache) {
//		super();
//		this.sub = sub;
//		this.cache = cache;
//	}

	public Query getSubQuery(){
		return this.sub;
	}

	public List<ConceptAssertion> getCache(){
		return this.cache;
	}
	

	public void setCache(List<ConceptAssertion> si){
		this.cache = si;
	}
	
	public void removeCache(){
		this.cache = null;
	}
	
	public void acceptVisitor(ScanQueryVisitorCacheSelector visitor){
		visitor.visit(this);
	}
	
	@Override
	public boolean isPure() {
		// TODO Auto-generated method stub
		return true;
	}

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return Display.QSCANUNICODE+"("+this.sub.toString()+")";
	}


	

}
